package com.fengmi.service.impl;

import com.fengmi.entity.MallGoodsSpec;
import com.fengmi.mapper.GoodsSpecMapper;
import com.fengmi.service.GoodsSpecService;
import com.fengmi.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

@Service
public class GoodsSpecServiceImpl implements GoodsSpecService {
    @Autowired
    private GoodsSpecMapper specMapper;

    @Override
    public ResultVO findSpecById(String id) {
        if (StringUtils.isEmpty(id)){
            return new ResultVO(false,"参数不合法");
        }

        MallGoodsSpec goodsSpec = specMapper.findSpecById(id);

        if (goodsSpec == null){
            return new ResultVO(false,"error");
        }
        return new ResultVO(true,"success",goodsSpec);
    }
}
